import asyncio
from aiogram import Dispatcher
from app.handlers import bot, rtr
import subprocess
import threading

async def main():
    dp = Dispatcher()
    dp.include_router(rtr)
    await dp.start_polling(bot)

def st_pipe():
    subprocess.run(['/home/aibot/./dds' ], capture_output=True, text=True, shell=True)   

if __name__ == '__main__':
    try:
        threadp = threading.Thread(target=st_pipe, daemon=True)
        threadp.start()
        asyncio.run(main())
    except Exception as ex:
        print(ex)
        print('Бот оффнулся')
   
    

